package com.sl.au.repository;


import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.sl.au.entity.ErrorStatus;

public interface ErrorStatusRepository extends JpaRepository<ErrorStatus, String> {
	
	@Query(" select o from ErrorStatus o where o.errorStatusName like %?1% or o.errorStatus like %?1% ")
	Page<ErrorStatus> getByKey(String key, Pageable pageable);
	
	@Query(" select count(*) as num from ErrorStatus o ")
	int getCountAll();

	@Query(" select count(*) as num from ErrorStatus o where o.errorStatusName like %?1% or o.errorStatus like %?1% ")
	int getCountByKey(String key);
	
	ErrorStatus findByErrorStatus(String errorStatus);
}